package com.um.jdy.platform.shop.controller;

import com.um.jdy.platform.base.entity.vo.AreaTreeNode;
import com.um.jdy.platform.shop.entity.dto.DeliveryTemplateListDTO;
import com.um.jdy.platform.shop.entity.dto.DeliveryTemplatePageDTO;
import com.um.jdy.platform.shop.manager.DeliveryTemplateManager;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.jdy.common.shop.service.DeliveryTemplateService;
import com.um.jdy.common.shop.entity.po.DeliveryTemplate;
import com.um.jdy.common.shop.entity.dto.DeliveryTemplateDTO;
import com.um.jdy.common.shop.entity.vo.DeliveryTemplateVO;
import com.um.springboot.starter.orm.controller.BasePlusController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 控制器：运费模板表
 */
@RestController
@RequestMapping("/api/v1/cms/shop/delivery_template")
@Api(tags = "DeliveryTemplateController", description = "运费模板表")
@ApiPermission("template")
@TokenRequired
public class DeliveryTemplateController extends BasePlusController<DeliveryTemplateManager, DeliveryTemplateService, DeliveryTemplate, DeliveryTemplateDTO, DeliveryTemplateVO, DeliveryTemplatePageDTO, DeliveryTemplateListDTO> {

    @ApiOperation("地区列表")
    @GetMapping("/get_area_data")
    public Response<List<AreaTreeNode>> getAreaData() {
        return Response.success(manager.getAreaData());
    }

}
